home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0399 / 178 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.1 KB

  1. Date: Wed, 24 Mar 93 14:39:42 -0800
  2. From: ersmith@netcom.com (Eric R. Smith)
  3. Message-Id: <9303242239.AA29102@netcom4.netcom.com>
  4. To: hohmuth@freia.inf.tu-dresden.de, mint@terminator.rs.itd.umich.edu
  5. Subject: Re:  wanted: ARGV standard extension
  6.  
  7. >    If the command line does _not_ contain empty arguments,
  8. >    the old ARGV standard applies; there are no additions.  This is
  9. >    for maximal backwards compatibelity with old (unaware) applications.
  10.  
  11. I think this is an important thing to keep. Ian's \1 quoting suggestion
  12. is a good one, but unfortunately incompatible in 1 case (namely, when
  13. you're already passing \1 as the first character). Admittedly, this
  14. seems like a very rare thing; but one can imagine programs (e.g. tr)
  15. which might want to get binary arguments.
  16.  
  17. >    _If_ (and only if) there are empty arguments, they're substituted
  18. >    by single spaces, and their position in argv[] is signaled thru
  19. >    the value of the "ARGV=" environment variable (which was
  20. >    reserved by Atari's earlier standard for future usage).  Example:
  21. >        foo bar '' '' blah '' frob
  22. >    results in the following being appended to the child's environment:
  23. >        "ARGV=NULL:2,3,5\0foo\0bar\0 \0 \0blah\0 \0frob\0\0"
  24.  
  25. Sounds good to me. I like the list form of the NULL: part, too, rather
  26. than using a bit array (especially since there are likely to be few empty
  27. arguments in any given argument list).
  28.  
  29. I think such a list can be parsed in just 1 pass through the whole argument
  30. list, plus 1 second pass through just the "NULL:2,3,5" list. You
  31. parse the whole list the first time without worrying which arguments are
  32. null; then you step through the NULL list and write 0 into the first bytes
  33. of any NULL arguments. This shouldn't add much overhead to the ARGV
  34. code. Ian: does that take care of your objection? Or am I overlooking
  35. something?
  36.  
  37. (pedantic aside: "NULL" may not be the best keyword; maybe "NIL" would be
  38. better, since the arguments aren't NULL pointers, they're pointers to empty
  39. strings.)
  40.  
  41. These statements shouldn't be taken as any kind of "official" comments
  42. from Atari; that will have to come later. This is just my opinion.
  43.  
  44. Eric
  45.